package javaDemo10.java程序设计作业;

public class Account {
    private String name;
    private String account;

    private String password;
    private double money;

    public Account(String name, String account, String password, double money) {
        this.name = name;
        this.account = account;
        this.password = password;
        this.money = money;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj.getClass() != this.getClass() || obj == null) {
            return false;
        }
        Account obja = (Account) obj;
        if (this.getAccount().equals(obja.getAccount())) {
            return true;
        } else {
            return false;
        }

    }

    @Override
    public String toString() {
        return "所有者: " + name + "  账户: " + account + "  余额: " + money + "  ";
    }
}
